package com.ws.mapper;

import com.ws.bean.User;
import com.ws.bean.vo.UserVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {

    List<User> list(UserVo userVo);

    @Insert("insert into user(user_name,user_pass,user_phone,user_tx,user_date) values(#{user_name},#{user_pass},#{user_phone},#{user_tx},#{user_date})")
    int add(User user);

    @Delete("delete from user where user_id=#{userId}")
    int delete(Integer userId);

    @Select("select * from user where user_id=#{userId}")
    User selUserOne(Integer userId);

    @Update("update user set user_name=#{user_name},user_pass=#{user_pass},user_phone=#{user_phone},user_tx=#{user_tx},user_date=#{user_date} where user_id=#{user_id}")
    int update(User user);
}
